import { createApp } from 'vue'
import App from './App.vue'

import { router } from "./router" 
import store from './store'
import mitt from 'mitt'
// import countTo from 'vue-count-to';
//css 
import './assets/reset.css'

import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
//引入中文，use时传入，解决组件英文的问题
import locale  from 'element-plus/lib/locale/lang/zh-cn'
// import dataV from '@jiaminghi/data-view'



// locale.use(lang)


import './assets/iconfont.css'
import animated from "animate.css";

// 使用最新API  createAPP 
// router.beforeEach((to, from ,next) => {
//   axios.get('http://192.168.0.137:8081/api/jwtUser').then((res)=>{
//     console.log(res.data)
//   }).catch((error)=>{
//     console.log(error.response)
//     window.location.href=error.response.data.redirectUrl + encodeURIComponent("http://192.168.0.112:8080")
//   })
// })

const app =  createApp(App)

app.config.globalProperties.$mybus = mitt()
app.use(animated)
app.use(router)
app.use(store)
app.use(ElementPlus,{ locale })
app.mount('#app')
const areaCut = (data) => {
    let arr = data.split('/').slice(1);
    let result = arr.filter((item)=>{
        return item !="";
    })
    return result;
}

